/*
 * Copyright (c) 2018-2999 九五云信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 */

package com.yami.shop.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yami.shop.bean.model.NotifyLog;
import com.yami.shop.bean.param.OrderParam;
import com.yami.shop.common.util.PageParam;
import com.yami.shop.dao.NotifyLogMapper;
import com.yami.shop.service.NotifyLogService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 *
 *
 * @author lhd
 * @date 2020-07-01 15:44:27
 */
@Service
@AllArgsConstructor
public class NotifyLogServiceImpl extends ServiceImpl<NotifyLogMapper, NotifyLog> implements NotifyLogService {

    private final NotifyLogMapper notifyLogMapper;

    @Override
    public IPage<NotifyLog> pageByParam(PageParam<NotifyLog> page, OrderParam orderParam) {
        IPage<NotifyLog> notifyLogIPage = notifyLogMapper.pageByParam(page, orderParam);
        for (NotifyLog record : notifyLogIPage.getRecords()) {
            if(Objects.equals(record.getSendType(),0)){
                record.setShopName("平台");
            }
        }
        return notifyLogIPage;
    }
}
